#include <bits/stdc++.h>
// 2025/01/23
// tag: 
// Author: Zhang Muen
using namespace std;

int n, a[100001], b[100001], pos[100001];
int ans[100001];
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    for (int i = 1; i <= n; i++)
        cin >> b[i];
    int cnt = 0;
    priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> q;
    for (int i = 1; i <= n; i++)
        q.push(make_pair(a[i] + b[1], i)), pos[i] = 1;
    while (cnt < n){
        auto x = q.top();
        q.pop();
        ans[++cnt] = x.first;
        q.push(make_pair(x.first - b[pos[x.second]] + b[++pos[x.second]], x.second));
    }
    for (int i = 1; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}